package com.tpay.server.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

// CGroup - App
@Entity
@Table(name="MA_COGRP_APP", uniqueConstraints={@UniqueConstraint(columnNames={"CG_ID", "APP_ID"})})
public class CgroupApp {
	@Id
	@GeneratedValue
	@Column(name="CGAPP_ID")
	private Integer id;
		
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="CG_ID", nullable=false)
	private Cgroup cgroup;
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="APP_ID", nullable=false)
	private App app;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Cgroup getCgroup() {
		return cgroup;
	}

	public void setCgroup(Cgroup cgroup) {
		this.cgroup = cgroup;
	}

	public App getApp() {
		return app;
	}

	public void setApp(App app) {
		this.app = app;
	}
	
	
}
